{extend name="property/public/insidePageBase" /}
{block name="title"}编辑公摊设备{/block}
{block name="body"}
<div class="layuimini-container">
    <div class="layuimini-main">
        <div class="layui-form  layui-form-pane">
            <div class="layui-row">
                <div class="layui-col-xs6">
                    <div class="layui-form-item">
                        <label class="layui-form-label">方案呢称</label>
                        <div class="layui-input-block">
                            <input type="text" name="plan_name" value="{$info['plan_name']}" placeholder="请输入方案名称" class="layui-input" lay-verify="required" autocomplete="off"/>
                        </div>
                    </div>
                </div>
                <div class="layui-col-xs6">
                    <div class="layui-form-item">
                        <label class="layui-form-label">设备类型</label>
                        <div class="layui-input-block">
                            <select name="energy_type" lay-filter="energy_type" disabled>
                                <option value="">--请选择--</option>
                                {foreach $energyTypeData as $k=>$v}
                                <option value="{$k}" {:isset($info['energy_type']) ? $info['energy_type'] == $k ? 'selected' : '' : ''}>{$v}</option>
                                {/foreach}
                            </select>
                        </div>
                    </div>
                </div>

            </div>

            <div class="layui-form-item" pane="">
                <label class="layui-form-label">公摊方式</label>
                <div class="layui-input-block">
                    <input type="radio" name="plan_type" lay-filter="plan_type" autocomplete="off" value="1" title="按面积公摊" {if $info['plan_type'] == 1}checked{/if}>
                    <input type="radio" name="plan_type" lay-filter="plan_type" autocomplete="off" value="2" title="按比例公摊" {if $info['plan_type'] == 2}checked{/if}>
                    <!--                    <input type="radio" name="shared_type" autocomplete="off" value="3" title="按用量比例" {if $info['shared_type'] == 3}checked{/if}>-->
                </div>
            </div>
            <div class="layui-form-item plan_type_b" pane="" {if $info['plan_type'] != 2}style="display: none"{/if}>
                <label class="layui-form-label">比例方式</label>
                <div class="layui-input-block">
                    <input type="radio" name="is_type" autocomplete="off" value="1" title="默认按比例均分" {if $info['is_type'] == 1}checked{/if}>
                    <input type="radio" name="is_type" autocomplete="off" value="2" title="自定义比例分摊" {if $info['is_type'] == 2}checked{/if}>
                </div>
            </div>
            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label">备注说明</label>
                <div class="layui-input-block">
                    <textarea placeholder="请输入备注说明"  name="remark" class="layui-textarea">{$info['shared_name']}</textarea>
                </div>
            </div>
            <div class="layui-form-item layui-hide">
                <button class="layui-btn" lay-submit lay-filter="submitBtn" id="submitBtn">提交</button>
            </div>
        </div>
    </div>
</div>
{/block}
{block name="js"}
{__block__}
<script>
    layui.use([ 'form', 'layer'], function () {
        var form = layui.form,layer = layui.layer,$ = layui.$;
        form.on('radio(plan_type)', function(data) {
            if(data.value == 1) {
                $('.plan_type_b').hide();
            }
            if(data.value == 2) {
                $('.plan_type_b').show();
            }
        });
    });
</script>
{/block}